
import { axiosGet, axiosPost, axiosPut } from '/@/api/RequestBase';
import { SqlSugarPagedList, BaseKeywordPageInput } from '/@/api/BaseDto';

import { BasShuXueJianYanInput } from './dto/BasShuXueJianYanInput';
import { BasShuXueJianYanOutput } from './dto/BasShuXueJianYanOutput';
import { BasShuXueJianYanAllOutput } from './dto/BasShuXueJianYanAllOutput';

export type { BasShuXueJianYanInput, BasShuXueJianYanOutput, BasShuXueJianYanAllOutput };

const service = 'BasShuXueJianYan/'; // 要写后面的斜杠, 不要写前面的斜杠

export const BasShuXueJianYanApi = {
	page: (data: BaseKeywordPageInput) => {
		return axiosPost<SqlSugarPagedList<BasShuXueJianYanOutput>>(service + 'page', data);
	},
	all: () => {
		return axiosPost<Array<BasShuXueJianYanAllOutput>>(service + 'all', {});
	},
	get: (id: number) => {
		return axiosGet<BasShuXueJianYanOutput>(service + `get/${id}`);
	},
	add: (data: BasShuXueJianYanInput) => {
		return axiosPost<number>(service + 'add', data);
	},
	update: (data: BasShuXueJianYanInput) => {
		return axiosPut<boolean>(service + 'update', data);
	},
}
